# -*- coding: utf-8 -*-
'''
@文件    :client.py
@说明    :request客户端
@时间    :2025/08/25 16:38:04
@作者    :浪晋
@版本    :1.0
'''

import httpx

class Requests:
    async def request(self, method, url, **kwargs):
        """httpx异步请求方法"""
        async with httpx.AsyncClient() as client:
            response  = await client.request(method, url, **kwargs)
            return response




if __name__ == '__main__':
    import asyncio
    requests = Requests()
    async def demo():
        response = await requests.request("GET", "http://127.0.0.1:3456/api/debug/test/demo")  # 非阻塞，交还控制权
        print(response.text)


    asyncio.run(demo())